// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC

@use "ds/_borders.scss" as *;
@use "ds/_sizes.scss" as *;
@use "ds/typography.scss" as *;

.option {
  --options-fg-color: var(--color-foreground-primary);
  --options-bg-color: unset;
  --options-empty: var(--color-canvas);

  display: grid;
  align-items: center;
  justify-items: start;
  grid-template-columns: 1fr auto;
  gap: var(--sp-xs);
  width: 100%;
  height: $sz-32;
  padding: var(--sp-s);
  border-radius: $br-8;
  outline: $b-1 solid var(--options-outline-color);
  outline-offset: calc(-1 * $b-1);
  background-color: var(--options-bg-color);
  color: var(--options-fg-color);

  &:hover,
  &[aria-selected="true"] {
    --options-bg-color: var(--color-background-quaternary);
  }
}

.option-with-icon {
  grid-template-columns: auto 1fr auto;
}

.option-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  min-width: 0;
  padding-inline-start: var(--sp-xxs);
}

.option-text-dimmed {
  color: var(--options-empty);
}

.option-icon {
  color: var(--options-icon-fg-color);
}

.option-current {
  --options-outline-color: var(--color-accent-primary);
  outline: $b-1 solid var(--options-outline-color);
}

.option-selected {
  --options-fg-color: var(--color-accent-primary);
  --options-icon-fg-color: var(--color-accent-primary);
}
